package com.holyant.goods.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.domain.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;

/**
 * 需要维护价格发送钉钉卡片历史记录dto
 * 
 * @author fkmalls
 * @date 2023-12-18
 */
@Data
@ApiModel("需要维护价格发送钉钉卡片历史记录")
public class GdsSkuMaintenanceHistoryDto extends BaseDto {

    private static final long serialVersionUID = 1L;

    /** 报价类型(10成本价20结算价) */
    @Excel(name = "报价类型(10成本价20结算价)")
    @ApiModelProperty(value = "报价类型(10成本价20结算价)")
    private Integer quoteType;

    /** 渠道类型 */
    private String channel;
    /** 来源订单号 */
    private String srcCode;
    /** 来源平台 */
    private String srcPlatform;
    /** 订单编号 */
    private String orderCode;

    /** 店铺id */
    private Long shopId;
    /** 店铺名称 */
    private String shopName;


    /** skuid */
    @Excel(name = "skuid")
    @ApiModelProperty(value = "skuid")
    private Long skuId;
    /** sku编码 */
    @Excel(name = "sku编码")
    @ApiModelProperty(value = "sku编码")
    private String skuCode;
    /** sku名称 */
    @Excel(name = "sku名称")
    @ApiModelProperty(value = "sku名称")
    private String skuName;
    /** 商品id */
    @Excel(name = "商品id")
    @ApiModelProperty(value = "商品id")
    private Long goodsId;
    /** 商品名称 */
    @Excel(name = "商品名称")
    @ApiModelProperty(value = "商品名称")
    private String goodsName;
    /** 商品条码 */
    @Excel(name = "商品条码")
    @ApiModelProperty(value = "商品条码")
    private String goodsBarcode;
    /** 商品编码 */
    @Excel(name = "商品编码")
    @ApiModelProperty(value = "商品编码")
    private String goodsCode;
    /** 品牌id */
    @Excel(name = "品牌id")
    @ApiModelProperty(value = "品牌id")
    private Long brandId;
    /** 品牌 */
    @Excel(name = "品牌")
    @ApiModelProperty(value = "品牌")
    private String brandName;
    /** 失效日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "失效日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "失效日期")
    private LocalDate expireDate;
    /** 账期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "账期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "账期")
    private LocalDate stampDate;


    public static GdsSkuMaintenanceHistoryDto convert(NotMaintainSkuPriceExportDto notMaintainSkuPriceExportDto,Integer quoteType){
        GdsSkuMaintenanceHistoryDto maintenanceHistoryDto = new GdsSkuMaintenanceHistoryDto();
        maintenanceHistoryDto.setQuoteType(quoteType);
        maintenanceHistoryDto.setStampDate(LocalDate.now());
        maintenanceHistoryDto.setExpireDate(notMaintainSkuPriceExportDto.getExpireDate());
        maintenanceHistoryDto.setSkuId(notMaintainSkuPriceExportDto.getSkuId());
        maintenanceHistoryDto.setSkuCode(notMaintainSkuPriceExportDto.getSkuCode());
        maintenanceHistoryDto.setSkuName(notMaintainSkuPriceExportDto.getSkuName());
        maintenanceHistoryDto.setGoodsId(notMaintainSkuPriceExportDto.getGoodsId());
        maintenanceHistoryDto.setGoodsBarcode(notMaintainSkuPriceExportDto.getGoodsBarcode());
        maintenanceHistoryDto.setGoodsName(notMaintainSkuPriceExportDto.getGoodsName());
        maintenanceHistoryDto.setGoodsCode(notMaintainSkuPriceExportDto.getGoodsCode());
        maintenanceHistoryDto.setBrandId(notMaintainSkuPriceExportDto.getBrandId());
        maintenanceHistoryDto.setBrandName(notMaintainSkuPriceExportDto.getBrandName());
        return maintenanceHistoryDto;
    }




}
